class CartController < ApplicationController
  include CartHelper

  def shopping_cart
    delete_good_info
    show_price
    update_count
  end

  def show_price
    total_price = 0
    total =  count_total_price(total_price)
    @total_price ='%.2f' % total
  end

  def ajax_free_goods
    @free_goods_info = FreeGoodsInfo.all
    render :json => @free_goods_info
  end

  def update_count
    FreeGoodsInfo.all.each do |i|
      update_free(i)
    end
  end

  def save_good_count
    update_cart_count(params)
    render :json => {:status => true}
  end

end
